/**
 * fshows.com
 * Copyright (C) 2013-2019 All Rights Reserved.
 */
package com.example.fardemo.jmh.counter.impl;

import com.example.fardemo.jmh.counter.ICounter;

/**
 * 同步计数器
 *
 * @author Liluqing
 * @version SyncCounter.java, v 0.1 2019-05-06 14:45
 */
public class SyncCounter implements ICounter {

    private  volatile long i = 0;

    @Override
    public synchronized void hit() {
        i++;
    }

    @Override
    public long getRequestSum() {
        return i;
    }

    @Override
    public void close() {

    }
}